define(['jquery'],()=>{
    const tabs_url = 'http://quan.lukou.com/api/tabs'
    const tab_base_list1 = 'http://quan.lukou.com/api/tab'
    const tab_details = 'http://quan.lukou.com/api/detail'
    const get = (url,data)=>{
        return new Promise((resolve,reject)=>{
            $.get(url,data,resp=>{
                resolve(resp)
            })
        })        
    }
    return {
        //获取全局数据
        getTabs(){
            return get(tabs_url)
        },
        //回去分类商品
        getList(id){
            return get(`${tab_base_list1}/${id}`)
        },
        getListDetail(id){
            return get(`${tab_base_list1}/${id}`)
        },
        //获取商品详情
        getTabDetail(id){
            return get(`${tab_details}?id=${id}`)
        }
    }
})